/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80041
 Source Host           : localhost:3306
 Source Schema         : stellar-meet

 Target Server Type    : MySQL
 Target Server Version : 80041
 File Encoding         : 65001

 Date: 03/06/2025 18:32:51
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for auth_permission
-- ----------------------------
DROP TABLE IF EXISTS `auth_permission`;
CREATE TABLE `auth_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `permission_name` varchar(255) NOT NULL COMMENT '权限名称',
  `parent_id` bigint DEFAULT NULL COMMENT '父ID',
  `type` tinyint NOT NULL COMMENT '权限类型 0-菜单 1-操作',
  `menu_url` varchar(255) DEFAULT NULL COMMENT '菜单路由',
  `permission_status` varchar(30) DEFAULT 'enabled' COMMENT '状态 disabled-禁用 enabled-启用',
  `show` tinyint DEFAULT '1' COMMENT '展示状态 0-隐藏 1-展示',
  `icon` varchar(255) DEFAULT NULL COMMENT '图标',
  `permission_key` varchar(100) NOT NULL COMMENT '权限唯一标识',
  `created_by` varchar(50) DEFAULT NULL COMMENT '创建者',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  `sort` int DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_permission_key` (`permission_key`),
  KEY `idx_parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限表';

-- ----------------------------
-- Records of auth_permission
-- ----------------------------
BEGIN;
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (1, '系统管理', NULL, 0, '#', 'enabled', 1, 'SettingOutlined', 'System', NULL, '2025-06-01 14:04:59', '1', '2025-06-02 23:27:20', 0, 9);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (2, '菜单管理', 1, 1, '/system/menu', 'enabled', 1, 'MenuOutlined', 'SystemMenu', NULL, '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (3, '角色管理', 1, 1, '/system/role', 'enabled', 1, 'AppstoreOutlined', 'SystemRole', NULL, '2025-06-01 14:05:05', '1', '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (4, '菜单新增', 2, 2, NULL, 'enabled', 1, NULL, 'system:menu:add', NULL, '2025-05-29 14:39:28', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (5, '菜单编辑', 2, 2, NULL, 'enabled', 1, NULL, 'system:menu:edit', NULL, '2025-05-29 14:39:50', '1', '2025-06-02 23:27:20', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (6, '菜单列表', 2, 2, NULL, 'enabled', 1, NULL, 'system:menu:list', NULL, '2025-05-29 14:40:10', '1', '2025-06-02 23:27:20', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (7, '菜单删除', 2, 2, NULL, 'enabled', 1, NULL, 'system:menu:delete', NULL, '2025-05-29 14:40:22', '1', '2025-06-02 23:27:20', 0, 4);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (8, '用户管理', NULL, 1, '/user', 'enabled', 1, 'UserOutlined', 'User', NULL, '2025-05-29 16:43:43', '1', '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (9, '开发管理', NULL, 1, '/dev-tools', 'enabled', 1, 'TwitterOutlined', 'DevTools', NULL, '2025-05-29 16:49:03', '1', '2025-06-02 23:27:20', 0, 10);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (10, '角色新增', 3, 2, '', 'enabled', 1, '', 'system:role:add', '1', '2025-05-31 23:58:43', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (11, '角色编辑', 3, 2, '', 'enabled', 1, '', 'system:role:edit', '1', '2025-05-31 23:59:22', '1', '2025-06-02 23:27:20', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (12, '角色列表', 3, 2, '', 'enabled', 1, '', 'system:role:list', '1', '2025-05-31 23:59:40', '1', '2025-06-02 23:27:20', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (13, '角色删除', 3, 2, '', 'enabled', 1, '', 'system:role:delete', '1', '2025-05-31 23:59:57', NULL, '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (14, '菜单收缩', 2, 2, '', 'enabled', 1, '', 'system:menu:expand', '1', '2025-06-01 00:05:43', NULL, '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (15, '用户新增', 8, 2, '', 'enabled', 1, '', 'user:add', '1', '2025-06-01 01:06:11', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (16, '用户编辑', 8, 2, '', 'enabled', 1, '', 'user:edit', '1', '2025-06-01 01:06:11', '1', '2025-06-02 23:27:20', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (17, '用户列表', 8, 2, '', 'enabled', 1, '', 'user:list', '1', '2025-06-01 01:06:11', '1', '2025-06-02 23:27:20', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (18, '用户删除', 8, 2, '', 'enabled', 1, '', 'user:delete', '1', '2025-06-01 01:06:11', '1', '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (19, '学校管理', NULL, 0, '', 'enabled', 1, 'BankOutlined', 'School', '1', '2025-06-02 12:53:35', '1', '2025-06-02 23:27:20', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (20, '学校列表', 19, 1, '/school/list', 'enabled', 1, 'DatabaseOutlined', 'SchoolList', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (21, '学校管理员', 19, 1, '/school/manager', 'enabled', 1, 'SecurityScanOutlined', 'SchoolManager', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (22, '学校列表新增', 20, 2, '', 'enabled', 1, '', 'school:list:add', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (23, '学校列表编辑', 20, 2, '', 'enabled', 1, '', 'school:list:edit', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (24, '学校列表列表', 20, 2, '', 'enabled', 1, '', 'school:list:list', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (25, '学校列表删除', 20, 2, '', 'enabled', 1, '', 'school:list:delete', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (26, '学校管理员新增', 21, 2, '', 'enabled', 1, '', 'school:manager:add', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (27, '学校管理员编辑', 21, 2, '', 'enabled', 1, '', 'school:manager:edit', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (28, '学校管理员列表', 21, 2, '', 'enabled', 1, '', 'school:manager:list', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (29, '学校管理员删除', 21, 2, '', 'enabled', 1, '', 'school:manager:delete', '1', '2025-06-01 14:05:02', '1', '2025-06-02 23:27:20', 0, 4);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (30, '学校信息', 19, 1, '/school/info', 'enabled', 1, 'BookOutlined', 'SchoolInfo', '1', '2025-06-02 13:02:19', '1', '2025-06-02 23:27:20', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (31, '学校信息修改', 30, 2, '', 'enabled', 1, '', 'school:info:edit', '1', '2025-06-02 13:02:53', '1', '2025-06-02 23:27:20', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (32, '学校信息查看', 30, 2, '', 'enabled', 1, '', 'school:info:query', '1', '2025-06-02 13:03:34', NULL, '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (33, '学校列表搜索', 20, 2, '', 'enabled', 1, '', 'school:list:search', '1', '2025-06-02 14:41:33', '1', '2025-06-02 23:27:20', 0, 5);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (34, '学校列表重置', 20, 2, '', 'enabled', 1, '', 'school:list:reset', '1', '2025-06-02 14:41:56', '1', '2025-06-02 23:27:20', 0, 4);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (35, '用户搜索', 21, 2, '', 'enabled', 1, '', 'school:manager:search', '1', '2025-06-02 17:00:52', NULL, '2025-06-02 23:27:20', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (36, '用户状态', 8, 2, '', 'enabled', 1, '', 'user:ban', '1', '2025-06-03 16:05:02', NULL, NULL, 0, 4);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (37, '圈子管理', NULL, 0, '', 'enabled', 1, 'RocketOutlined', 'Circles', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:26:43', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (38, '帖子管理', 37, 1, '/circles/post', 'enabled', 1, 'ReadOutlined', 'CirclesPost', '1', '2025-06-03 16:24:00', '1', '2025-06-03 18:28:18', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (39, '话题管理', 37, 1, '/circles/tag', 'enabled', 1, 'BulbOutlined', 'CirclesTag', '1', '2025-06-03 16:24:00', '1', '2025-06-03 18:28:27', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (40, '分类管理', 37, 1, '/circles/category', 'enabled', 1, 'ShareAltOutlined', 'CirclesCategory', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (41, '评论列表', 37, 1, '/circles/comment', 'enabled', 1, 'MonitorOutlined', 'CirclesComment', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (42, '帖子新增', 38, 2, '', 'enabled', 1, '', 'circle:post:add', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (43, '帖子编辑', 38, 2, '', 'enabled', 1, '', 'circle:post:edit', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (44, '帖子列表', 38, 2, '', 'enabled', 1, '', 'circle:post:list', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (45, '帖子删除', 38, 2, '', 'enabled', 1, '', 'circle:post:delete', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (46, '话题新增', 39, 2, '', 'enabled', 1, '', 'circle:tag:add', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (47, '话题修改', 39, 2, '', 'enabled', 1, '', 'circle:tag:edit', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (48, '话题列表', 39, 2, '', 'enabled', 1, '', 'circle:tag:list', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (49, '话题删除', 39, 2, '', 'enabled', 1, '', 'circle:tag:delete', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (50, '分类新增', 40, 2, '', 'enabled', 1, '', 'circle:category:add', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (51, '分类修改', 40, 2, '', 'enabled', 1, '', 'circle:category:edit', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (52, '分类列表', 40, 2, '', 'enabled', 1, '', 'circle:category:list', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (53, '分类删除', 40, 2, '', 'enabled', 1, '', 'circle:category:delete', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (54, '评论新增', 41, 2, '', 'enabled', 1, '', 'circle:comment:add', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 0);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (55, '分类编辑', 41, 2, '', 'enabled', 1, '', 'circle:comment:edit', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 1);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (56, '评论列表', 41, 2, '', 'enabled', 1, '', 'circle:comment:list', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 2);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (57, '评论删除', 41, 2, '', 'enabled', 1, '', 'circle:comment:delete', '1', '2025-06-03 16:24:00', '1', '2025-06-03 16:30:11', 0, 3);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (58, '测试管理', NULL, 0, '', 'enabled', 1, 'ClockCircleOutlined', 'Test', '1', '2025-06-03 18:24:56', NULL, '2025-06-03 18:26:31', 1, 4);
INSERT INTO `auth_permission` (`id`, `permission_name`, `parent_id`, `type`, `menu_url`, `permission_status`, `show`, `icon`, `permission_key`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`, `sort`) VALUES (59, '测试页面', 58, 1, '/test/demo', 'enabled', 1, 'EnvironmentOutlined', 'TestInfo', '1', '2025-06-03 18:25:24', '1', '2025-06-03 18:26:31', 1, 0);
COMMIT;

-- ----------------------------
-- Table structure for auth_role
-- ----------------------------
DROP TABLE IF EXISTS `auth_role`;
CREATE TABLE `auth_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_name` varchar(255) NOT NULL COMMENT '角色名称（如 super_admin-超级管理员、school_admin学校管理员、normal_user普通用户））',
  `role_key` varchar(100) NOT NULL COMMENT '角色唯一标识',
  `role_status` varchar(30) DEFAULT 'enabled' COMMENT '状态 disabled-禁用 enabled-启用',
  `created_by` varchar(50) DEFAULT NULL COMMENT '创建者',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_role_key` (`role_key`),
  KEY `idx_status` (`role_status`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表';

-- ----------------------------
-- Records of auth_role
-- ----------------------------
BEGIN;
INSERT INTO `auth_role` (`id`, `role_name`, `role_key`, `role_status`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (1, '超级管理员', 'super_admin', 'enabled', NULL, '2025-05-29 13:18:33', '1', '2025-06-03 18:25:53', 0);
INSERT INTO `auth_role` (`id`, `role_name`, `role_key`, `role_status`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (2, '学校管理员', 'school_admin', 'enabled', NULL, '2025-06-01 13:22:46', '1', '2025-06-02 13:31:45', 0);
INSERT INTO `auth_role` (`id`, `role_name`, `role_key`, `role_status`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (3, '开发管理员', 'dev_admin', 'enabled', '1', '2025-06-01 13:22:30', NULL, NULL, 0);
COMMIT;

-- ----------------------------
-- Table structure for auth_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `auth_role_permission`;
CREATE TABLE `auth_role_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `permission_id` bigint NOT NULL COMMENT '权限ID',
  `created_by` varchar(50) DEFAULT NULL COMMENT '创建者',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=359 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色权限关联表';

-- ----------------------------
-- Records of auth_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (16, 3, 1, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (17, 3, 2, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (18, 3, 3, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (19, 3, 8, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (20, 3, 4, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (21, 3, 5, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (22, 3, 6, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (23, 3, 7, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (24, 3, 14, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (25, 3, 10, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (26, 3, 11, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (27, 3, 12, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (28, 3, 13, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (29, 3, 15, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (30, 3, 9, NULL, '2025-06-01 13:22:30', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (104, 2, 9, NULL, '2025-06-02 13:31:45', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (105, 2, 31, NULL, '2025-06-02 13:31:45', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (106, 2, 32, NULL, '2025-06-02 13:31:45', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (107, 2, 30, NULL, '2025-06-02 13:31:45', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (108, 2, 19, NULL, '2025-06-02 13:31:45', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (300, 1, 1, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (301, 1, 2, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (302, 1, 3, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (303, 1, 4, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (304, 1, 5, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (305, 1, 6, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (306, 1, 7, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (307, 1, 8, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (308, 1, 9, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (309, 1, 10, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (310, 1, 11, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (311, 1, 12, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (312, 1, 13, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (313, 1, 14, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (314, 1, 15, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (315, 1, 16, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (316, 1, 17, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (317, 1, 18, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (318, 1, 19, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (319, 1, 20, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (320, 1, 21, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (321, 1, 22, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (322, 1, 23, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (323, 1, 24, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (324, 1, 25, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (325, 1, 26, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (326, 1, 27, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (327, 1, 28, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (328, 1, 29, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (329, 1, 30, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (330, 1, 31, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (331, 1, 32, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (332, 1, 33, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (333, 1, 34, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (334, 1, 35, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (335, 1, 36, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (336, 1, 37, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (337, 1, 38, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (338, 1, 39, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (339, 1, 40, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (340, 1, 41, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (341, 1, 42, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (342, 1, 43, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (343, 1, 44, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (344, 1, 45, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (345, 1, 46, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (346, 1, 47, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (347, 1, 48, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (348, 1, 49, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (349, 1, 50, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (350, 1, 51, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (351, 1, 52, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (352, 1, 53, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (353, 1, 54, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (354, 1, 55, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (355, 1, 56, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (356, 1, 57, NULL, '2025-06-03 18:25:53', NULL, NULL, 0);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (357, 1, 58, NULL, '2025-06-03 18:25:53', NULL, '2025-06-03 18:29:58', 1);
INSERT INTO `auth_role_permission` (`id`, `role_id`, `permission_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (358, 1, 59, NULL, '2025-06-03 18:25:53', NULL, '2025-06-03 18:30:00', 1);
COMMIT;

-- ----------------------------
-- Table structure for auth_user
-- ----------------------------
DROP TABLE IF EXISTS `auth_user`;
CREATE TABLE `auth_user` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `user_type` varchar(20) NOT NULL DEFAULT 'wechat' COMMENT '用户类型：wechat-微信用户/anonymous-匿名用户',
  `openid` varchar(200) NOT NULL COMMENT '微信用户唯一标识（OpenID）',
  `nick_name` varchar(100) DEFAULT NULL COMMENT '微信昵称',
  `avatar` varchar(500) DEFAULT NULL COMMENT '微信头像URL',
  `school_id` bigint DEFAULT NULL COMMENT '绑定的学校ID',
  `student_id` varchar(50) DEFAULT NULL COMMENT '学号',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `default_avatar` varchar(500) DEFAULT NULL COMMENT '系统默认马甲头像URL',
  `default_nick_name` varchar(100) DEFAULT NULL COMMENT '系统默认昵称',
  `sex` tinyint DEFAULT NULL COMMENT '性别 1-男 2-女',
  `phone` varchar(30) DEFAULT NULL COMMENT '手机号',
  `grade` varchar(30) DEFAULT NULL COMMENT '年级',
  `user_status` varchar(20) NOT NULL DEFAULT 'normal' COMMENT '用户状态：normal-正常/banned-封禁',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
  `last_ip` varchar(45) DEFAULT NULL COMMENT '最后登录IP',
  `login_count` int DEFAULT '0' COMMENT '累计登录次数',
  `stellar_meet_code` bigint NOT NULL COMMENT '星遇号 - 唯一',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_openid` (`openid`),
  UNIQUE KEY `uniq_school_student` (`school_id`,`student_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统用户信息表';

-- ----------------------------
-- Records of auth_user
-- ----------------------------
BEGIN;
INSERT INTO `auth_user` (`id`, `user_type`, `openid`, `nick_name`, `avatar`, `school_id`, `student_id`, `email`, `default_avatar`, `default_nick_name`, `sex`, `phone`, `grade`, `user_status`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`, `last_login_time`, `last_ip`, `login_count`, `stellar_meet_code`) VALUES (1, 'wechat', 'admin', '超级管理员', 'https://nymall.tos-cn-guangzhou.volces.com/f08f8cb9-a238-4def-872c-53dde4a9d026.png.webp', 1, NULL, '969531133@qq.com', NULL, NULL, 1, '13800138001', NULL, 'normal', '2025-05-29 13:16:20', NULL, '2025-06-02 23:18:31', '2', 0, '2025-06-03 18:28:47', '0.0.0.0', 1, 1008666);
INSERT INTO `auth_user` (`id`, `user_type`, `openid`, `nick_name`, `avatar`, `school_id`, `student_id`, `email`, `default_avatar`, `default_nick_name`, `sex`, `phone`, `grade`, `user_status`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`, `last_login_time`, `last_ip`, `login_count`, `stellar_meet_code`) VALUES (2, 'wechat', 'school', '李知恩', 'https://nymall.tos-cn-guangzhou.volces.com/f628a607-ecdd-489f-9197-73ae8838148c.png.webp', 4, NULL, '10086@qq.com', NULL, NULL, 2, '13800138002', NULL, 'normal', '2025-05-31 15:35:26', NULL, '2025-06-03 16:05:21', '1', 0, '2025-06-02 22:14:05', '0.0.0.0', 1, 1008667);
COMMIT;

-- ----------------------------
-- Table structure for auth_user_role
-- ----------------------------
DROP TABLE IF EXISTS `auth_user_role`;
CREATE TABLE `auth_user_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `created_by` varchar(50) DEFAULT NULL COMMENT '创建者',
  `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` varchar(50) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_user_role` (`user_id`,`role_id`),
  KEY `fk_role_id` (`role_id`),
  CONSTRAINT `fk_role_id` FOREIGN KEY (`role_id`) REFERENCES `auth_role` (`id`),
  CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色关联表';

-- ----------------------------
-- Records of auth_user_role
-- ----------------------------
BEGIN;
INSERT INTO `auth_user_role` (`id`, `user_id`, `role_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (1, 1, 1, NULL, '2025-05-29 13:18:53', NULL, '2025-05-29 13:54:53', 0);
INSERT INTO `auth_user_role` (`id`, `user_id`, `role_id`, `created_by`, `created_time`, `update_by`, `update_time`, `is_deleted`) VALUES (2, 2, 2, NULL, '2025-05-31 15:36:32', NULL, '2025-05-31 17:47:33', 0);
COMMIT;

-- ----------------------------
-- Table structure for s_banner
-- ----------------------------
DROP TABLE IF EXISTS `s_banner`;
CREATE TABLE `s_banner` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '唯一标识符',
  `img_url` varchar(255) NOT NULL COMMENT '图片存储路径（OSS地址或本地路径）',
  `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '类型：1-帖子轮播图 2-首页轮播图 3-活动轮播图',
  `relation_id` bigint DEFAULT NULL COMMENT '关联ID（帖子ID，type=1时必填）',
  `sort` int NOT NULL DEFAULT '0' COMMENT '排序权重（越大越靠前）',
  `banner_status` varchar(20) NOT NULL DEFAULT '1' COMMENT '启用状态：disabled-禁用 enabled-启用',
  `background` varchar(20) DEFAULT '#FFFFFF' COMMENT '背景色（支持十六进制）',
  `jump_type` tinyint(1) DEFAULT '0' COMMENT '跳转类型：0-无跳转 1-帖子详情 2-自定义跳转路径',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  `jump_url` varchar(255) DEFAULT NULL COMMENT '自定义跳转路径',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='轮播图存储表';

-- ----------------------------
-- Records of s_banner
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_chat_message
-- ----------------------------
DROP TABLE IF EXISTS `s_chat_message`;
CREATE TABLE `s_chat_message` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '消息ID，主键',
  `conversation_id` varchar(64) NOT NULL COMMENT '会话ID（格式：user1Id_user2Id，按数字大小排序）',
  `sender_id` bigint NOT NULL COMMENT '发送者ID（关联auth_user表id）',
  `receiver_id` bigint NOT NULL COMMENT '接收者ID（关联auth_user表id）',
  `content` text COMMENT '消息内容',
  `content_type` varchar(20) NOT NULL DEFAULT 'text' COMMENT '消息类型：text-文本/image-图片/file-文件',
  `is_hidden` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否被隐藏：0-否/1-是（敏感内容自动隐藏）',
  `hidden_reason` varchar(256) DEFAULT NULL COMMENT '隐藏原因',
  `is_read` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已读：0-否/1-是',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_conversation` (`conversation_id`),
  KEY `idx_sender_receiver` (`sender_id`,`receiver_id`),
  KEY `idx_receiver_status` (`receiver_id`,`is_read`),
  CONSTRAINT `fk_message_receiver` FOREIGN KEY (`receiver_id`) REFERENCES `auth_user` (`id`),
  CONSTRAINT `fk_message_sender` FOREIGN KEY (`sender_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='私聊消息表';

-- ----------------------------
-- Records of s_chat_message
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_chat_relationship
-- ----------------------------
DROP TABLE IF EXISTS `s_chat_relationship`;
CREATE TABLE `s_chat_relationship` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '关系ID，主键',
  `user_id` bigint NOT NULL COMMENT '用户ID（关联auth_user表id）',
  `friend_id` bigint NOT NULL COMMENT '好友ID（关联auth_user表id）',
  `is_blocked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否拉黑：0-否/1-是',
  `block_time` datetime DEFAULT NULL COMMENT '拉黑时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_user_friend` (`user_id`,`friend_id`),
  KEY `fk_relationship_friend` (`friend_id`),
  CONSTRAINT `fk_relationship_friend` FOREIGN KEY (`friend_id`) REFERENCES `auth_user` (`id`),
  CONSTRAINT `fk_relationship_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户聊天关系表';

-- ----------------------------
-- Records of s_chat_relationship
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_chat_sensitive_log
-- ----------------------------
DROP TABLE IF EXISTS `s_chat_sensitive_log`;
CREATE TABLE `s_chat_sensitive_log` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID，主键',
  `message_id` bigint NOT NULL COMMENT '消息ID（关联s_chat_message表id）',
  `user_id` bigint NOT NULL COMMENT '触发用户ID（关联auth_user表id）',
  `sensitive_words` text COMMENT '检测到的敏感词',
  `action` varchar(20) NOT NULL DEFAULT 'hide' COMMENT '采取动作：hide-隐藏/warn-警告/block-封禁',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_message` (`message_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `fk_sensitive_message` FOREIGN KEY (`message_id`) REFERENCES `s_chat_message` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='聊天敏感词记录表';

-- ----------------------------
-- Records of s_chat_sensitive_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_comment
-- ----------------------------
DROP TABLE IF EXISTS `s_comment`;
CREATE TABLE `s_comment` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '评论ID，主键',
  `user_id` bigint NOT NULL COMMENT '评论用户ID（关联user表id）',
  `source_id` bigint NOT NULL COMMENT '关联来源ID（帖子ID或闲置物品ID）',
  `source_type` varchar(20) NOT NULL COMMENT '来源类型：post-帖子/idle-闲置物品',
  `parent_id` bigint DEFAULT NULL COMMENT '父评论ID（关联本表id，NULL表示一级评论）',
  `root_id` bigint DEFAULT NULL COMMENT '根评论ID（关联本表id，NULL表示一级评论）',
  `content` text NOT NULL COMMENT '评论内容',
  `images` json DEFAULT NULL COMMENT '评论图片（JSON数组格式存储URL）',
  `is_anonymous` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否匿名：0-实名/1-匿名',
  `is_hidden` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否被隐藏：0-否/1-是（敏感内容自动隐藏）',
  `hidden_reason` varchar(256) DEFAULT NULL COMMENT '隐藏原因',
  `comment_status` varchar(20) NOT NULL DEFAULT 'published' COMMENT '状态：published-已发布/hidden-已隐藏/deleted-已删除',
  `like_count` int DEFAULT '0' COMMENT '点赞数',
  `reply_count` int DEFAULT '0' COMMENT '回复数',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_source` (`source_type`,`source_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_parent` (`parent_id`),
  KEY `idx_root` (`root_id`),
  KEY `idx_status` (`comment_status`),
  CONSTRAINT `fk_comment_parent` FOREIGN KEY (`parent_id`) REFERENCES `s_comment` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_comment_root` FOREIGN KEY (`root_id`) REFERENCES `s_comment` (`id`) ON DELETE SET NULL,
  CONSTRAINT `fk_comment_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='评论表';

-- ----------------------------
-- Records of s_comment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_comment_like
-- ----------------------------
DROP TABLE IF EXISTS `s_comment_like`;
CREATE TABLE `s_comment_like` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '点赞ID，主键',
  `comment_id` bigint NOT NULL COMMENT '评论ID（关联s_comment表id）',
  `user_id` bigint NOT NULL COMMENT '点赞用户ID（关联auth_user表id）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_user_comment` (`user_id`,`comment_id`),
  KEY `fk_like_comment` (`comment_id`),
  CONSTRAINT `fk_like_comment` FOREIGN KEY (`comment_id`) REFERENCES `s_comment` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='评论点赞表';

-- ----------------------------
-- Records of s_comment_like
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_comment_sensitive_log
-- ----------------------------
DROP TABLE IF EXISTS `s_comment_sensitive_log`;
CREATE TABLE `s_comment_sensitive_log` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID，主键',
  `comment_id` bigint NOT NULL COMMENT '评论ID（关联s_comment表id）',
  `user_id` bigint NOT NULL COMMENT '触发用户ID（关联user表id）',
  `sensitive_words` text COMMENT '检测到的敏感词',
  `action` varchar(20) NOT NULL DEFAULT 'hide' COMMENT '采取动作：hide-隐藏/warn-警告/block-封禁',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_comment` (`comment_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `fk_sensitive_comment` FOREIGN KEY (`comment_id`) REFERENCES `s_comment` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='评论敏感词记录表';

-- ----------------------------
-- Records of s_comment_sensitive_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_idle
-- ----------------------------
DROP TABLE IF EXISTS `s_idle`;
CREATE TABLE `s_idle` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '闲置物品ID，主键',
  `user_id` bigint NOT NULL COMMENT '发布用户ID（关联user表id）',
  `school_id` bigint NOT NULL COMMENT '学校ID（关联school表id）',
  `idle_type` varchar(20) NOT NULL COMMENT '发布类型：sell-出售/buy-求购',
  `title` varchar(100) NOT NULL COMMENT '物品标题',
  `description` text NOT NULL COMMENT '物品详细描述',
  `images` json DEFAULT NULL COMMENT '物品照片（JSON数组格式存储URL）',
  `price` decimal(10,2) NOT NULL COMMENT '物品价格（求购时为期望价格）',
  `category` varchar(50) DEFAULT NULL COMMENT '物品分类（如书籍/电子/服饰等）',
  `contact_name` varchar(50) NOT NULL COMMENT '联系人姓名',
  `contact_phone` varchar(20) NOT NULL COMMENT '联系电话',
  `contact_wechat` varchar(50) DEFAULT NULL COMMENT '微信（可选）',
  `transaction_place` varchar(100) DEFAULT NULL COMMENT '交易地点',
  `idle_status` varchar(20) NOT NULL DEFAULT 'pending' COMMENT '状态：pending-审核中/published-已发布/completed-已完成/closed-已关闭',
  `complete_time` datetime DEFAULT NULL COMMENT '完成时间',
  `view_count` int DEFAULT '0' COMMENT '浏览数',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_school_status` (`school_id`,`idle_status`),
  KEY `idx_type_status` (`idle_type`,`idle_status`),
  CONSTRAINT `fk_idle_school` FOREIGN KEY (`school_id`) REFERENCES `s_school` (`id`),
  CONSTRAINT `fk_idle_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='闲置物品交易表';

-- ----------------------------
-- Records of s_idle
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_pin_payment
-- ----------------------------
DROP TABLE IF EXISTS `s_pin_payment`;
CREATE TABLE `s_pin_payment` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID，主键',
  `post_id` bigint NOT NULL COMMENT '帖子ID（关联s_post表id）',
  `tag_id` varchar(64) DEFAULT NULL COMMENT '置顶话题ID（NULL表示全局置顶）,多个话题ID使用-隔开',
  `payment_amount` decimal(10,2) NOT NULL COMMENT '支付金额',
  `payment_method` varchar(20) DEFAULT NULL COMMENT '支付方式',
  `payment_time` datetime NOT NULL COMMENT '支付时间',
  `duration_days` int NOT NULL COMMENT '置顶天数',
  `expire_time` datetime NOT NULL COMMENT '过期时间',
  `transaction_id` varchar(100) DEFAULT NULL COMMENT '第三方交易ID',
  `payment_status` varchar(20) NOT NULL DEFAULT 'pending' COMMENT '支付状态：pending-处理中/success-成功/failed-失败',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_post` (`post_id`),
  KEY `idx_expire` (`expire_time`),
  CONSTRAINT `fk_pin_payment_post` FOREIGN KEY (`post_id`) REFERENCES `s_post` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='帖子置顶付费记录表';

-- ----------------------------
-- Records of s_pin_payment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_post
-- ----------------------------
DROP TABLE IF EXISTS `s_post`;
CREATE TABLE `s_post` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '帖子ID，主键',
  `user_id` bigint NOT NULL COMMENT '发布用户ID（关联user表id，匿名时也需记录）',
  `school_id` bigint NOT NULL COMMENT '学校ID（关联school表id）',
  `category_id` bigint DEFAULT NULL COMMENT '分类ID（关联s_post_category表id）',
  `title` varchar(100) DEFAULT NULL COMMENT '帖子标题',
  `content` text NOT NULL COMMENT '帖子内容',
  `images` json DEFAULT NULL COMMENT '图片列表（JSON数组格式存储URL）',
  `is_anonymous` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否匿名：0-实名/1-匿名',
  `post_status` varchar(20) NOT NULL DEFAULT 'pending' COMMENT '帖子状态：published-已发布/pending-审核中/hidden-隐藏',
  `view_count` int DEFAULT '0' COMMENT '浏览数',
  `like_count` int DEFAULT '0' COMMENT '点赞数',
  `comment_count` int DEFAULT '0' COMMENT '评论数',
  `is_pinned` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否置顶：0-否/1-是',
  `pin_expire_time` datetime DEFAULT NULL COMMENT '置顶过期时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_school_status` (`school_id`,`post_status`),
  KEY `idx_pinned` (`is_pinned`,`pin_expire_time`),
  KEY `fk_post_user` (`user_id`),
  KEY `fk_post_category` (`category_id`),
  CONSTRAINT `fk_post_category` FOREIGN KEY (`category_id`) REFERENCES `s_post_category` (`id`),
  CONSTRAINT `fk_post_school` FOREIGN KEY (`school_id`) REFERENCES `s_school` (`id`),
  CONSTRAINT `fk_post_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='校园墙帖子表';

-- ----------------------------
-- Records of s_post
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_post_category
-- ----------------------------
DROP TABLE IF EXISTS `s_post_category`;
CREATE TABLE `s_post_category` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '分类ID，主键',
  `category_name` varchar(50) NOT NULL COMMENT '分类名称',
  `category_sort` int DEFAULT '0' COMMENT '分类排序（数字越小越靠前）',
  `is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用：0-禁用/1-启用',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_name_school` (`category_name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='帖子分类表';

-- ----------------------------
-- Records of s_post_category
-- ----------------------------
BEGIN;
INSERT INTO `s_post_category` (`id`, `category_name`, `category_sort`, `is_enabled`, `create_time`, `create_by`, `update_time`, `update_by`, `is_deleted`) VALUES (1, '表白', 1, 1, '2025-06-03 18:17:28', NULL, NULL, NULL, 0);
INSERT INTO `s_post_category` (`id`, `category_name`, `category_sort`, `is_enabled`, `create_time`, `create_by`, `update_time`, `update_by`, `is_deleted`) VALUES (2, '吐槽', 2, 1, '2025-06-03 18:17:31', NULL, '2025-06-03 18:20:15', '1', 0);
COMMIT;

-- ----------------------------
-- Table structure for s_post_like
-- ----------------------------
DROP TABLE IF EXISTS `s_post_like`;
CREATE TABLE `s_post_like` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '点赞ID，主键',
  `post_id` bigint NOT NULL COMMENT '帖子ID（关联s_post表id）',
  `user_id` bigint NOT NULL COMMENT '点赞用户ID（关联user表id）',
  `like_type` varchar(20) DEFAULT 'like' COMMENT '点赞类型：like-点赞/support-支持等（可扩展）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_user_post` (`user_id`,`post_id`) COMMENT '同一用户对同一帖子只能点赞一次',
  KEY `idx_post` (`post_id`) COMMENT '帖子查询优化',
  CONSTRAINT `fk_like_post` FOREIGN KEY (`post_id`) REFERENCES `s_post` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_like_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='帖子点赞表';

-- ----------------------------
-- Records of s_post_like
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_post_tag
-- ----------------------------
DROP TABLE IF EXISTS `s_post_tag`;
CREATE TABLE `s_post_tag` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '话题ID，主键',
  `post_tag_name` varchar(50) NOT NULL COMMENT '话题名称',
  `description` varchar(200) DEFAULT NULL COMMENT '话题描述',
  `usage_count` int DEFAULT '0' COMMENT '使用次数',
  `is_pinned` tinyint(1) DEFAULT '0' COMMENT '是否置顶话题：0-否/1-是',
  `tag_sort` int DEFAULT '0' COMMENT '话题排序、数字越小越靠前',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_tag_name` (`post_tag_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='话题表';

-- ----------------------------
-- Records of s_post_tag
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_post_tag_mapping
-- ----------------------------
DROP TABLE IF EXISTS `s_post_tag_mapping`;
CREATE TABLE `s_post_tag_mapping` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '关联ID，主键',
  `post_id` bigint NOT NULL COMMENT '帖子ID（关联s_post表id）',
  `tag_id` bigint NOT NULL COMMENT '话题ID（关联s_tag表id）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  `school_id` bigint DEFAULT NULL COMMENT '学校ID',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_post_tag` (`post_id`,`tag_id`),
  KEY `fk_post_tag_tag` (`tag_id`),
  CONSTRAINT `fk_post_tag_post` FOREIGN KEY (`post_id`) REFERENCES `s_post` (`id`) ON DELETE CASCADE,
  CONSTRAINT `fk_post_tag_tag` FOREIGN KEY (`tag_id`) REFERENCES `s_post_tag` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='帖子话题关联表';

-- ----------------------------
-- Records of s_post_tag_mapping
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_reward
-- ----------------------------
DROP TABLE IF EXISTS `s_reward`;
CREATE TABLE `s_reward` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '赏金任务ID，主键',
  `user_id` bigint NOT NULL COMMENT '发布用户ID（关联user表id）',
  `school_id` bigint DEFAULT NULL COMMENT '学校ID（关联school表id）',
  `reward_type` varchar(20) NOT NULL COMMENT '赏金类型：pickup-取货/help-求助',
  `title` varchar(100) NOT NULL COMMENT '任务标题',
  `content` text NOT NULL COMMENT '任务详细内容',
  `images` json DEFAULT NULL COMMENT '任务相关图片（JSON数组格式存储URL）',
  `amount` decimal(10,2) DEFAULT NULL COMMENT '赏金金额',
  `scope` varchar(20) NOT NULL DEFAULT 'current' COMMENT '任务范围：all-不限/current-本校/campus-校区',
  `target_campus_id` varchar(32) DEFAULT NULL COMMENT '目标校区（当scope=campus或者current时必填，支持多选学校，使用-分割）',
  `delivery_address` varchar(255) DEFAULT NULL COMMENT '送达地址（取货类型必填）',
  `contact_name` varchar(50) NOT NULL COMMENT '联系人姓名',
  `contact_phone` varchar(20) NOT NULL COMMENT '联系电话',
  `contact_wechat` varchar(50) DEFAULT NULL COMMENT '微信（可选）',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注信息',
  `reward_status` varchar(20) NOT NULL DEFAULT 'pending' COMMENT '任务状态：pending-审核中/published-已发布/completed-已完成/closed-已关闭',
  `accept_user_id` bigint DEFAULT NULL COMMENT '接单用户ID（关联user表id）',
  `complete_time` datetime DEFAULT NULL COMMENT '完成时间',
  `view_count` int DEFAULT '0' COMMENT '浏览数',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `create_by` varchar(100) DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_school_status` (`school_id`,`reward_status`),
  KEY `idx_type_status` (`reward_type`,`reward_status`),
  KEY `fk_reward_accept_user` (`accept_user_id`),
  CONSTRAINT `fk_reward_accept_user` FOREIGN KEY (`accept_user_id`) REFERENCES `auth_user` (`id`),
  CONSTRAINT `fk_reward_school` FOREIGN KEY (`school_id`) REFERENCES `s_school` (`id`),
  CONSTRAINT `fk_reward_user` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='赏金任务表';

-- ----------------------------
-- Records of s_reward
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for s_school
-- ----------------------------
DROP TABLE IF EXISTS `s_school`;
CREATE TABLE `s_school` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '学校ID',
  `school_name` varchar(200) NOT NULL COMMENT '学校名称',
  `campuses` varchar(32) DEFAULT NULL COMMENT '校区',
  `school_status` varchar(20) NOT NULL DEFAULT 'active' COMMENT '学校状态：active-激活/inactive-未激活',
  `school_avatar` varchar(300) NOT NULL COMMENT '学校头像',
  `longitude` decimal(10,6) DEFAULT NULL COMMENT '经度',
  `latitude` decimal(10,6) DEFAULT NULL COMMENT '纬度',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学校信息表';

-- ----------------------------
-- Records of s_school
-- ----------------------------
BEGIN;
INSERT INTO `s_school` (`id`, `school_name`, `campuses`, `school_status`, `school_avatar`, `longitude`, `latitude`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`) VALUES (1, '广东农工商职业技术学院', '粤垦路校区', 'active', 'https://lanyun-tc.oss-cn-guangzhou.aliyuncs.com/6bf2eb25-3c1f-4a92-985b-4e36a61f6427.jpg', 113.331992, 23.157007, '2025-06-02 15:35:37', NULL, '2025-06-02 16:16:28', '1', 0);
INSERT INTO `s_school` (`id`, `school_name`, `campuses`, `school_status`, `school_avatar`, `longitude`, `latitude`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`) VALUES (4, '广东农工商职业技术学院', '增城校区', 'active', 'https://lanyun-tc.oss-cn-guangzhou.aliyuncs.com/a6375175-a766-4602-aa52-1963a177cd23.jpg', 113.615230, 23.282208, '2025-06-02 15:35:37', '1', '2025-06-02 19:05:07', '1', 0);
INSERT INTO `s_school` (`id`, `school_name`, `campuses`, `school_status`, `school_avatar`, `longitude`, `latitude`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`) VALUES (5, '广州番禺职业技术学院', '主校区', 'inactive', 'https://lanyun-tc.oss-cn-guangzhou.aliyuncs.com/8c3ac22f-a418-4fa6-a034-2e727158e7e5.jpg', 113.307110, 22.902721, '2025-06-02 19:04:24', '1', '2025-06-02 19:06:30', '1', 0);
COMMIT;

-- ----------------------------
-- Table structure for s_school_admin
-- ----------------------------
DROP TABLE IF EXISTS `s_school_admin`;
CREATE TABLE `s_school_admin` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `school_id` bigint NOT NULL COMMENT '学校ID',
  `admin_id` bigint NOT NULL COMMENT '管理员用户ID',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  `created_by` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
  `update_time` datetime DEFAULT NULL COMMENT '修改时间',
  `update_by` varchar(100) DEFAULT NULL COMMENT '修改人',
  `is_deleted` tinyint(1) DEFAULT '0' COMMENT '是否删除：1-删除/0-未删除',
  `real_name` varchar(255) NOT NULL COMMENT '管理员真实姓名',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_school_admin` (`school_id`,`admin_id`),
  KEY `admin_id` (`admin_id`),
  CONSTRAINT `s_school_admin_ibfk_1` FOREIGN KEY (`school_id`) REFERENCES `s_school` (`id`),
  CONSTRAINT `s_school_admin_ibfk_2` FOREIGN KEY (`admin_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学校管理员映射表';

-- ----------------------------
-- Records of s_school_admin
-- ----------------------------
BEGIN;
INSERT INTO `s_school_admin` (`id`, `school_id`, `admin_id`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`, `real_name`) VALUES (1, 1, 1, '2025-06-02 17:17:48', '1', '2025-06-02 17:54:13', '1', 0, '彭于晏');
INSERT INTO `s_school_admin` (`id`, `school_id`, `admin_id`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`, `real_name`) VALUES (2, 1, 2, '2025-06-02 18:09:23', '1', NULL, NULL, 0, '李知恩');
INSERT INTO `s_school_admin` (`id`, `school_id`, `admin_id`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`, `real_name`) VALUES (3, 4, 1, '2025-06-02 18:10:55', '1', NULL, NULL, 0, '彭于晏');
INSERT INTO `s_school_admin` (`id`, `school_id`, `admin_id`, `created_time`, `created_by`, `update_time`, `update_by`, `is_deleted`, `real_name`) VALUES (4, 5, 1, '2025-06-02 23:06:31', '1', NULL, NULL, 0, '刘亦菲');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
